package data;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Michal Hanzlik, Tomas Jiran
 */
@Entity
@Table(name = "hodnoceni")
@IdClass(HodnoceniId.class)
public class Hodnoceni implements Serializable {
    @Id
    @Column()
    private long id_filmu;

    @Id
    @Column()
    private long id_osoby;

    @Column()
    private int hodnotil;

    @ManyToOne
    @PrimaryKeyJoinColumn(name = "id_osoby", referencedColumnName = "id_osoby")
    private Uzivatel uzivatel;

    @ManyToOne
    @PrimaryKeyJoinColumn(name = "id_filmu", referencedColumnName = "id_filmu")
    private Film film;
    
    public Hodnoceni() {
    }

    public void setId_filmu(long id_filmu) {
        this.id_filmu = id_filmu;
    }

    public void setId_osoby(long id_osoby) {
        this.id_osoby = id_osoby;
    }

    public void setFilm(Film film) {
        this.film = film;
    }

    public void setUzivatel(Uzivatel uzivatel) {
        this.uzivatel = uzivatel;
    }

    public void setHodnotil(int hodnotil) {
        this.hodnotil = hodnotil;
    }

    public Uzivatel getUzivatel() {
        return uzivatel;
    }

    public long getId_osoby() {
        return id_osoby;
    }

    public long getId_filmu() {
        return id_filmu;
    }

    public int getHodnotil() {
        return hodnotil;
    }

    public Film getFilm() {
        return film;
    }
}